package com.wex.app;

import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;
import ohos.agp.components.Component;
import ohos.agp.components.Text;

public class VideoTestAbility extends Ability {

    private Text title = null;
    private Button btnPlay = null;
    private Button btnStop = null;
    private Button btnExit = null;

    private void btnPlayCallback(Component component)
    {
        ;
    }
    private void btnStopCallback(Component component)
    {
        ;
    }
    private void btnExitCallback(Component component)
    {
        terminateAbility();
    }

    //获取ui控件控制符
    private void initComponents() {
        title = (Text) findComponentById(ResourceTable.Id_video_test_text);

        btnPlay = (Button) findComponentById(ResourceTable.Id_video_test_btn_play);
        btnStop = (Button) findComponentById(ResourceTable.Id_video_test_btn_stop);
        btnExit = (Button) findComponentById(ResourceTable.Id_video_test_btn_exit);

        btnPlay.setClickedListener(this::btnPlayCallback);
        btnStop.setClickedListener(this::btnStopCallback);
        btnExit.setClickedListener(this::btnExitCallback);
    }

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_video_test_ability);

        initComponents();
    }

    @Override
    public void onStop() {
        super.onStop();
    }
}
